{curl-file-attributes character-encoding = "shift-jis"}
<#import "xml_recurse.ftl" as xml_re>
<#import "object_recurse.ftl" as obj_re>
<#import "name_recurse.ftl" as name_re>
<#assign docno= doc.root.@docno>
<#recurse doc>

<#macro root>  
<#recurse>
</#macro>

<#macro node>
<#assign name = .node.@name>
<#assign type = .node.@type>
<#if type = "map">
{do
    let constant soap-struct-marshaler:SOAPStructMarshaler =
        {SOAPStructMarshaler
            {SOAPObjectType
                element-name = {XMLName "http://temp.openuri.org/Oscar/${docno}.xsd", "${name}"},
                xml-type = {XMLName "http://temp.openuri.org/Oscar/${docno}.xsd", "${name}"},
                curl-type = ${name?replace("_","-")?capitalize},
                nillable? = true
            },
            {{Array-of #XMLName}
            	<#recurse using xml_re>                 
            },
            {{Array-of SOAPObjectType}
            	<#recurse using obj_re>                  
            },
            {{Array-of String}
                <#recurse using name_re>  
            },
            element-name-to-xml-type = element-name-to-xml-type,
            xml-type-to-curl-type = xml-type-to-curl-type,
            curl-type-to-xml-type = curl-type-to-xml-type,
            xml-type-to-element-name = xml-type-to-element-name
        }
        {soap-struct-marshaler.register
            type-mapper = type-mapper,
            element-name-to-xml-type-mapper = element-name-to-xml-type,
            xml-type-to-curl-type-mapper = xml-type-to-curl-type,
            curl-type-to-xml-type-mapper = curl-type-to-xml-type,
            xml-type-to-element-name-mapper = xml-type-to-element-name
        }
}
<#elseif type="list">
	list
</#if>
<#if .node?node_name = "node">
<#recurse>
</#if>
</#macro>

<#macro element>	
</#macro>
